home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 44
/
Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso
/
Aminet
/
util
/
libs
/
DragnDrop14.lha
/
Dragndrop_demo.lha
/
DragnDrop
/
TestDragnDrop.p
< prev
next >
Wrap
Text File
|
1999-03-30
|
4KB
|
135 lines
{* Include sys:coder/preass/Options.p *}
{* Include sys:coder/preass/Prozeduren.p *}
{* String: Version="$VER: (C) CYBORG 1998-99"*}
{* Array[Long]: Drops,141,419,295,472,0,0,0,0,0,0*}
{* Array[Long]: Polygon1,22,13,141,13,82,70,81,70,22,13,0,0*}
{* Array[Long]: Polygon2,82,73,141,132,82,191,81,191,22,132,82,73,0,0*}
{* Array[Long]: Polygon3,22,254,81,195,82,195,141,254,22,254,0,0*}
{* Array[Long]: Polygon4,401,99,460,40,519,40,580,100,521,159,460,159,401,100,0,0*}
{* Array[Long]: Polygon5,28,447,138,418,138,474,28,447,0,0*}
{* Array[Long]: Polygon7,297,418,403,447,297,473,297,418,0,0*}
{* Array[Long]: Polygon8,228,134,634,374,602,475,518,459,158,226,228,134,0,0*}
{* Include module:Display_IFF.p*}
Open_Window[Lokal,Lokal1]:
Window=OpenGuiWindowA(000,000,640,480,Lokal1,
#IDCMP_MOUSEMOVE!IDCMP_MOUSEBUTTONS!IDCMP_GADGETDOWN!IDCMP_GADGETUP!IDCMP_REFRESHWINDOW!IDCMP_MENUPICK!IDCMP_VANILLAKEY!IDCMP_RAWKEY!0,
#WFLG_BACKDROP!WFLG_BORDERLESS!WFLG_REPORTMOUSE!0,
Lokal,0)
Checkf Window,Open_Windowende
GUI=CreateGuiInfoA(Window,0)
CreateGUIMenuEntryA(gui,001,"Projekt",0)
CreateGUIMenuEntryA(gui,002,"Quit",
>Menu001Tags:GEM_Shortcut,MenuShorCut001MSC="q"|
Tag_Done,0)
Open_Windowende:
{* Return Window*}
Close_Window[Lokal]:
{* IncVar: Lokal*}
CloseGuiWindow(Lokal)
RTS
Open_Screen[Screenmode,Lokal1]:
{* IncVar: Screenmode,Lokal1,Lokal2,Lokal3*}
Screen=OpenGuiScreenA(Screenmode,8,Lokal1,
>ScreenTags:SA_Font,TopazAttr|
SA_Left,0|SA_Top,0|SA_Behind,false|
SA_Width,640|SA_Height,480|
Tag_done,Null)
.Ende:
{* Return Screen*}
even
TopazAttr:
dc.l TopazName
dc.w 8
dc.b 0,0
Topazname:
dc.b "topaz.font",0
blk.b 29,0
Close_Screen[Lokal]:
CloseGuiScreen(Lokal)
RTS
Haupt[]:
{* IncVar: TA_Result*}
WaitGuiMsg(Gui)
MsgClass=.l36(Gui)
MsgGadNbr=.w52(Gui)
MsgMenuNum=.w54(Gui)
MsgItemNum=.w56(Gui)
Imsg=.l32(Gui)
Mx=.w32(Imsg)
My=.w34(Imsg)
dx==mx-mxa
dy==my-mya
mxa==mx
mya==my
If MsgClass=#IDCMP_MOUSEMOVE and Dragstatus=1 --> .Delta
If MsgClass=#IDCMP_MOUSEBUTTONS --> .Dragdrop
If MsgClass##IDCMP_MENUPICK --> Haupt
RTS
.DragDrop:
If DragStatus=1 --> .Drop
.Drag:
If (TA_result=DND_TestPolygon(&Polygon1,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon2,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon3,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon4,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon5,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon7,mx,my))#0 --> .Dragfound
If (TA_result=DND_TestPolygon(&Polygon8,mx,my))#0 --> .Dragfound Else Haupt
.dragfound:
Dragstatus==1
Drag=DND_OpenPolygon(Rastport1,TA_Result,Screen1)
bra Haupt
.Delta:
{* Flush *}
DND_MoveDrag(Drag,dx,dy)
bra Haupt
.Drop:
{* Flush *}
Dragstatus==0
DND_CloseDrag(Drag)
DND_FreeResult(TA_Result)
Drag==0
If (TA_result=DND_TestArea(&Drops,mx,my))=0 --> Haupt
DND_FreeResult(Ta_result)
.Dropfound:
GuiRequestA(Gui,"Drop!",#GER_Okkind,0)
bra Haupt
Hintergrundbild[Lokal]:
ScreenRastport=84(Screen1)
Viewport=44(Screen1)
Maxhoehe==480
DisplayIff(LOKAL,#Normal,Rastport1,00,0)
RTS
Start:
{* Incblock: Block,1024*}
IH=Input()
OH=Output()
If (Screen1=Open_Screen(#$39024,"Screen1"))#0 {
If (Window1=Open_Window(Screen1,"Window1"))#0 {
Gui1==Gui
Rastport1=.l50(Window1)
HintergrundBild("dragndrop.iff")
; DND_Draw(Rastport1,&Drags,1)
; DND_DrawPolygon(Rastport1,&polygon,1)
DrawGuiA(Gui1,0)
Gui==Gui1
Haupt()
Close_Window(Window1)
}
Close_Screen(Screen1)
}
RTS